//
//  main.m
//  block
//
//  Created by lanou on 16/10/20.
//  Copyright (c) 2016年 ZhouWC. All rights reserved.
//

#import <Foundation/Foundation.h>
void my(int num ){
void(^myblock)(int num) = ^(int num ) {
    
    for (int i=1; i<=num ; i++) {
        NSLog(@"hello world!");
    }
};
    myblock(num);
};
int (^max)(int a,int b,int c ) = ^(int a,int b,int c ){
    int max  = a>b?a:b;
        max  = max>c?max:c;
    return max;
};
int (^MaxNum)(int n ,int cha[]) = ^(int n,int cha[]){
    int num;
    for(int i = 0;i < n;i++){
        scanf("%d",&num);
        cha[i] =num;
    }
    int max = cha[0];
    for(int i = 0;i<n-1;i++){
         max = cha[i+1]>cha[i]?cha[i+1]:cha[i];
    }
    return max;
};
int* (^maopao)(int n ,int cha[]) = ^(int n,int cha[]){
    int temp;
    printf("请输入n个数");
    for(int i = 0;i < n;i++){
        scanf("%d",&cha[i]);
    }
    printf("循环开始");
    for(int i = 0;i<n;i++){
        for(int j = 0;j<n-i;j++){
            if(cha[j+1]<cha[j]){
                temp = cha[j+1];
                cha[j+1] = cha[j];
                cha[j] = temp;
            };
        };
    }
    return cha;
};
int main(int argc, const char * argv[]) {
    @autoreleasepool {
//        int num;
//        scanf("%d",&num);
//        my(num);
//        
//        int a,b,c;
//        scanf("%d %d %d",&a,&b,&c);
//        printf("%d",max(a,b,c));
//        
//        int n;
//        int cha[100];
//        scanf("%d",&n);
//       printf("%d", MaxNum(n,cha));
        int n;
        printf("请输入n");
        scanf("%d",&n);
        int ch[100];
        int *chb;
        chb =maopao(n,ch);
        for(int i= 1;i < n+1;i++){
            printf("%d",chb[i]);
        };
        
        
    }
    return 0;
}
